import Vue from 'vue'
import App from './App.vue'
import router from './router'
//全局混入
Vue.mixin({
    created: function () {
        console.log("这里是混入的created")
    },
    methods:{
        mixinMethod(){}
    }
})
//导入全局样式表
import "./assets/css/global.css";
//引入图标库
import "./assets/fonts/iconfont.css"


import './plugins/element.js'

import axios from "axios";

import TreeTable from 'vue-table-with-tree-grid'

// 导入富文本编辑器
import VueQuillEditor from 'vue-quill-editor'
// require styles 导入富文本编辑器对应的样式
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'

Vue.component('tree-table', TreeTable);
// 将富文本编辑器，注册为全局可用的组件
Vue.use(VueQuillEditor);

//导入进度条插件
import NProgress from 'nprogress'
import 'nprogress/nprogress.css'

axios.defaults.baseURL = 'https://www.liulongbin.top:8888/api/private/v1/';
axios.defaults.timeout = 5000;
//axios请求拦截器
axios.interceptors.request.use((config)=>{
    console.log("request---------->",config);
    NProgress.start();
    config.headers.Authorization = window.sessionStorage.getItem("token");
    return config;
});
axios.interceptors.response.use((config)=>{
    console.log("response---------->",config);
    let {data: {meta, data}} = config;
    console.log("response---------->data",data);
    NProgress.done();
    return config;
});

Vue.prototype.$http = axios;

// import axiosAPI from "../axiosAPI"
// Vue.prototype.$http = axiosAPI;



Vue.config.productionTip = false;

new Vue({
    router,
    render: h => h(App)
}).$mount('#app');
